local km = require("km")
local json = require("json")
local ioutil = require("ioutil")


local res = km.walk(".")

local obj = {}
local k = 1

for i,v in ipairs(res) do
    if not v.isDir then
        local newVal = {
            path = v.path,
            size = v.size,
            name = v.name,
            isDir = v.isDir,
            md5 = km.md5(v.path),
        }
        obj[k] = newVal
        k = k + 1
    end
end


local err = ioutil.write_file("tests/diff.json", json.encode(obj))
if err then error(err) end
